package com.coderedma.beans.factory;

import com.coderedma.beans.BeansException;

/**
 * @Author coderedma
 * @Desc Bean工厂
 * @createTime 2024/7/29 14:05
 * @since 1.0.0
 */
public interface BeanFactory {
    /**
     * 获取bean
     *
     * @param beanName
     * @return
     * @throws BeansException
     */
    Object getBean(String beanName) throws BeansException;

    /**
     * 获取bean
     *
     * @param beanName
     * @param requiredType
     * @param <T>
     * @return
     * @throws BeansException
     */
    <T> T getBean(String beanName, Class<T> requiredType) throws BeansException;

    <T> T getBean(Class<T> requiredType) throws BeansException;

    boolean containsBean(String beanName);

}
